package com.hinnotek.amoeba.ui.activity.old

import android.os.Bundle
import android.view.View
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.lee.common.base.BaseActivity
import com.hinnotek.amoeba.R
import com.hinnotek.amoeba.adapters.old.PTUserRelatedListAdapter
import com.hinnotek.amoeba.databinding.IncludeRecyclerviewBinding
import com.hinnotek.amoeba.utilities.IntentUtils
import java.util.*


class PTUserRelatedListActivity : BaseActivity<IncludeRecyclerviewBinding>() {
    private var listAdapter: PTUserRelatedListAdapter? = null
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.include_recyclerview)
        setLeftVisible(true)
        setTitle("项目")

    }

    override fun initVew() {
        val manager = LinearLayoutManager(mContext)
        manager.orientation = RecyclerView.VERTICAL
        bindingView.recyclerView.layoutManager = manager
        bindingView.recyclerView.adapter = PTUserRelatedListAdapter().also { listAdapter = it }
        listAdapter!!.setOnItemClickListener { adapter: BaseQuickAdapter<*, *>?, view: View?, position: Int ->
            IntentUtils.startActivity(
                mContext,
                PTProjectListActivity::class.java
            )
        }
    }

    override fun setData() {
        val stringList: MutableList<String> = ArrayList()
        for (i in 0..5) {
            stringList.add(i.toString() + "厂")
        }
        listAdapter!!.setList(stringList)
    }
}